package lion.framework.core.web.anno;

import lion.dev.lang.InterceptorAdaptor;
import lion.framework.core.bean.BeanFactory;

/**
 * @author lion
 * @email hl_0074@sina.com
 * @date 2015年4月28日
 */
public class ExecuteInterceptorSpec {

	private InterceptorAdaptor adaptor;
	private boolean proto = true;
	private Class<? extends InterceptorAdaptor> clazz;

	public ExecuteInterceptorSpec(Class<? extends InterceptorAdaptor> clazz, boolean proto) {

		this.clazz = clazz;
		this.proto = proto;
		if (this.proto) {
			this.adaptor = BeanFactory.create(this.clazz);
		}
	}

	public InterceptorAdaptor getAdapter() {

		if (this.proto) { return this.adaptor; }

		return BeanFactory.create(this.clazz);
	}

}
